ls1 = list(map(int,input().split()))
ls2 = list(map(int,input().split()))

ls3 = []

for i in ls1[1:]:
    if i not in ls2 and i not in ls3:
        ls3.append(i)

for i in ls2[1:]:
    if i not in ls1 and i not in ls3:
        ls3.append(i)

print(" ".join(map(str,ls3)))